The present invention relates to a chroma-key processing method and system for processing color image of various modes in the form of RGB numerical data into composite with another color image.
According to chroma-key technique used in producing a video image, a foreground object to be composited is placed in front of a background panel painted in monochrome, typically in blue, and is shot by a camera as material with blue background (hereinafter referred to as blue-back material). The shot image is variously processed into an image with key signals of blue portions being 0% and of foreground portions being 100%. The image with the key signals is supplied to a switching unit in a conversion system with a background different from that of the blue-back material to obtain a composite image. If the key signals have only binary states of either 0% or 100%, a contour of the foreground object after composite may become unnatural. In order to overcome the problem, conventionally a so-called soft chroma-key system is used to allow transitional values between 0% and 100%. According to the conventional soft chroma-key technique, key signals are generated in terms of distance on chromaticity diagram which can be quantitatively representative of hue and color saturation among three color attributes of hue, color saturation and color value. According to the Japanese Patent 1st publication No. 62-66791, data of RGB (Red, Green and Blue) three primary colors on a foreground image are converted into data (X, Z) on two-dimensional orthogonal coordinate system, using conversion equations: ##EQU1## where .phi. is an angle of hue of the background color to B-Y axis on chromaticity diagram. The values of X and Z obtained from the above equations are used to obtain value k of key signal: EQU k=X-aZ.sup.2
where a is an adjustable parameter. In reality, the value k is further used with variable gain k, and offset ko to obtain value k' as value of key signal: EQU k'=(k+k.sub.o)k.sub.g
According to this technique, data pairs of X and Z will draw a parabola with a focus and a directrix being respectively on the X and Z axes of a chromaticity diagram when the value k' becomes constant.
However, the orthogonal coordinate of X and Z in the prior art provides no information on color value and therefore cannot discriminate, for example, light blue from dark blue.
With the soft chroma-key system, the value of the key signal may take transitional value to process contour and semitransparent foreground. However, since such conventional system does not handle the build-up of the blue-back image based on a specific theory, extracted results may be often unnatural and/or any extra process step such as so-called "chroma cancel" which is inherently unnecessary may be required to improve apparent image quality.
In the case of division on chromaticity diagram by means of a single non-closing line, a foreground with colors of high and low saturations in combination cannot be processed by using a background with color of transitional saturation.
It has been proposed to determine parameters by cursor-pointing background positions on a screen, using a position pointer such as a mouse or tablet. However, this solution is limited to keying processing of a hard edge. Processing of dissolve portions of soft chroma-key with variable resistance cannot be intuitively manipulated.
According to the present invention, inputted RGB three primary color data are directly handled in three-dimensional space without mapping them over two-dimensional space such as a chromaticity diagram so as to use the data without loss of information quantity. Therefore, it is a function of 3 variables which determines the key value k of a key signal and it is expressed by a scalar field in RGB thee-dimensional space. This function is called an identification function.
When RGB data of foreground image taken by blue-back shooting are plotted in RGB three-dimensional space, pixels 1 of the background are distributed in a relatively small area near B axis as shown in FIG. 1. By contrast, pixels 2 of the foreground are distributed as several sets of banana-shaped areas at positions away from the pixels 1 of the background. Pixels on the boundary between pixels 1 and 2 are distributed substantially in an area of a triangle having its base and apex constituted by the banana-like distributed pixels 2 and the background pixels 1, respectively. In scalar field representative of key value k, it is ideal that there are the banana-like distributed pixels 2 by 100% and the background pixels 1 by 0% and that values gradually increase from the apex toward the base of the triangle.
The scalar field used to express identification function is defined by two hexoctahedrons 40 and 41 as shown in FIG. 2 with a shape suitable for distribution of the image data in RGB three-dimensional space, key value k being calculated which can smoothly express contour and/or semitransparent portions. Once key value k is determined, color of the pixel 2 of foreground portions related to background color such as semitransparent portions is converted to natural foreground color according to model induced from a theory of image composite.
Since the scalar field can be defined to include any arbitrary position on RGB three-dimensional space, restriction to background color is extensively reduced: and keying may be performed if there is no back color in the foreground color.
After chroma-key parameters have been set for hard edge, parameters for soft edge are specified for portions where even foreground may become transparent. Then, portions which are not to be transparent are repeatedly pointed by mouse or tablet on screen to set parameters for soft key.
A preferred embodiment of the present invention will be described in conjunction with the attached drawings.